<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <!-- Meta, title, CSS, favicons, etc. -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Cache-Control" content="no-cache" />
    <meta name="description" content="长沙市妇幼医院">
    <script src="./js/jquery.min.js"></script>
    <script src="./js/area/LAreaData2.js"></script>
     <script src="./js/sampleSheetCommon.js"></script>
    <title>长沙市妇幼医院</title>

    <!-- Documentation extras -->
    <style>
        body {
            font-family: "Microsoft YaHei UI", "Microsoft YaHei", "ff-tisa-web-pro-1", "ff-tisa-web-pro-2", "Lucida Grande", "Helvetica Neue", Helvetica, Arial, "Hiragino Sans GB", "Hiragino Sans GB W3", "WenQuanYi Micro Hei", sans-serif;
        }

        h1,
        .h1,
        h2,
        .h2,
        h4,
        .h4,
        h4,
        .h4,
        .lead {
            font-family: "Microsoft YaHei UI", "Microsoft YaHei", "ff-tisa-web-pro-1", "ff-tisa-web-pro-2", "Lucida Grande", "Helvetica Neue", Helvetica, Arial, "Hiragino Sans GB", "Hiragino Sans GB W3", "WenQuanYi Micro Hei", sans-serif;
        }

        #tip {
            width: 70%;
            position: absolute;
            left: 50%;
            top: 50%;
            margin-left: -35%;
            margin-top: -16%;
            border-radius: 5px;
            background: rgba(0, 0, 0, 0.7);
        }

        #tip p {
            padding: 8%;
            color: #fff;
            line-height: 24px;
        }
        .black_overlay {
            display: none;
            position: fixed;
            top: 0%;
            left: 0%;
            width: 100%;
            height: 100%;
            background-color:#000;
            z-index:1000;
            -moz-opacity: 0.8;
            opacity:.70;
            filter: alpha(opacity=70);
        }
        .tips-icon {
            padding-left: 5px;
        }

        .tips {
            display: none;
            position: fixed;
            width: 90%;
            margin-left: 5%;
            top: 100px;

            background-color: #fff;
            z-index: 1001;
            border: 1px solid #f3f3f3;
            border-radius: 10px;
        }

        .tips-msg {
            padding: 15px;
            color: #333;
            text-align: justify;
        }

        .tips-line {
            height: 1px;
            border-top: 1px solid #f3f3f3;
            ;
        }

        .tips-close {
            color: blue;
            text-align: center;
        }
    </style>
    <style>
        html,
        body {
            padding-top: 0;
            background-color: #ffffff;
            width: 100%;
            margin: 0;
            padding: 0;
        }

        #ban_bt {
            /*position:fixed;*/
            background-color: #07b8dd;
            bottom: 10px;
            z-index: 9999;
            text-align: center;
            margin-top: 25px;
            margin-left: auto;
            margin-right: auto;
            margin-bottom: 10px;
            left: 0;
            right: 0;

            height: 40px;
            width: 90%;
            border: 1px solid #dcdcdc;
            border-radius: 5px;
        }

        #ban_bt button {
            color: #fff;
            height: 40px;
            font-size: 20px;
            width: 100%;
            border: 0;
            background: 0;
        }

        #ban_bt.tian {
            background: #f883ad;
        }

        #ban_bt.tian button {
            color: #fff;
        }

        .text-cont {
            margin: 20px 6px 6px 6px;
            height: 75%;
            border: 1px solid #dcdcdc;
            border-radius: 5px;
            background-color: #fff;
            overflow: scroll;
        }

        .text-detail {
            font-size: 14px;
            text-align: justify;
            margin-left: 15px;
            margin-right: 15px;
            line-height: 20px;
            margin-top: 15px;
            color: #333333;
        }

        .text-title {
            font-size: 16px;
            text-align: center;
            margin-left: 20px;
            margin-right: 20px;
            margin-bottom: 30px;
            margin-top: 28px;
            color: #333333;
        }

        .text-qr {
            font-size: 16px;
            margin-left: 6px;
            margin-right: 6px;
            margin-top: 10px;
            color: #666;
        }

        .text-qr p {
            margin: 0;
            line-height: 28px;
        }

        .text-qr img {
            width: 22px;
            margin-right: 10px;
            vertical-align: middle;
        }

        .checkbox {
            width: 25px;
            height: 25px;
            padding: 0 5px 0 0;
            display: block;
            background-color: #fff;
        }

        .text-checkinfo {
            height: 25px;
            margin-top: 5px;
        }

        input[type=checkbox],
        input[type=radio] {
            appearance: none;
            width: 20px;
            height: 20px;
            margin-right: 10px;
            cursor: pointer;
            vertical-align: bottom;
            background: #fff;
            border: 1px solid #dcdcdc;
            -webkit-border-radius: 1px;
            -moz-border-radius: 1px;
            border-radius: 1px;
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box;
            position: relative;
        }

        input[type=checkbox]:checked,
        input[type=radio]:checked {
            background: #000;
        }

        .round {
            border: 0px solid #ffffff;
            -webkit-border-radius: 5px;
            color: #fff;
        }

        .prompt_message_block {
            background-color: #04aed1;
            height: 80px;
            width: 100%;
        }

        .prompt_message_icon {
            float: left;
            padding-top: 11px;
            padding-left: 16px;
            width: 14px;
            height: 14px;
        }

        .prompt_message_l {
            color: #ffffff;
            font-size: 15px;
            padding-left: 16px;
            padding-top: 21px;
            margin: 0;
        }

        .prompt_message_s {
            float: left;
            color: #ffffff;
            font-size: 14px;
            padding-left: 5px;
            padding-top: 11px;
            margin: 0;
        }

        .sheet_top {
            height: 45px;
        }

        .start_block {
            height: 17px;
            width: 5px;
            color: #07b8dd;
            margin-top: 15px;
            margin-bottom: 13px;
            background-color: #07b8dd;
            float: left;
        }

        .sheet_top_text {
            color: #333333;
            font-size: 15px;
            float: left;
            padding-left: 15px;
            padding-top: 13px;
        }

        .sheet_top_edit {
            float: right;
            padding-right: 20px;
            padding-top: 13px;
            color: #07b8dd;
            width: 50px;
            height: 15px;
        }

        .sheet_necessary_content {
            background-color: #f5f5f5;
            margin-left: 17px;
            margin-right: 17px;
        }

        .sheet_optional_content {
            background-color: #f5f5f5;
            margin-left: 17px;
            margin-right: 17px;
            margin-top: 8px;
            margin-bottom: 8px;
        }

        .sheet_text {
            padding-left: 15px;
            padding-top: 7px;
            padding-bottom: 7px;
            color: #333333;
            font-size: 14px;
            margin: 0 auto;
            line-height: 20px;
            height: 20px;
        }

        .sheet_label {
            text-align: justify;
            word-spacing: 23.5688px;
            float: left;
        }

        .sheet_value {
            margin-left: 15px;
            float: left;
        }

        .sheet_note {
            padding-top: 5px;
            padding-left: 15px;
        }

        .sheet_note_point {
            color: #d3d3d3;
        }

        .sheet_note_content {
            font-size: 12px;
            color: #bababa;
        }

        .confirm_button {
            background-color: #07b8dd;
            color: #ffffff;
            font-size: 20px;
            margin-left: 15px;
            margin-right: 15px;
            margin-top: 25px;
            height: 40px;
            margin-bottom: 10px;
            text-align: center;
            line-height: 40px;
        }

        .mark {
            border-bottom: 1px solid #ffa800;
            color: #ffa800;
        }
    </style>
    
    <script>
        var hospitalData = '';
        var errorMsg = '';
        var couponNum='';
        var sampleBaseId='';
        personInfo = {id:'',name:'',barcodeImg:''}
        $(document).ready(function(){
            initUrlInfo()
            doQuery(couponNum);
            doQuerySample();
        })
        function doQuery(couponNum){
            var url = "/csfy/wx/getPresonInfo.do";
            if(couponNum){
                url = url + '?' + 'couponNum='+couponNum+'&withImgCode=1';
            }else{
                return
            }
            $.ajax({
            	  url: "/csfy/getUrlBarcode.do",
            	  async:false,
            	  data:{
            		  "url":couponNum
            	  },
            	  success: function(data){
            	    alert(data);
            	  }
            	});
            $.ajax({
                type:"post",
                url:url,
                data:{},
                dataType:"json",
                success:function (data) {
                    var info = data.data
                    personInfo.id=info.id;
                    personInfo.name=info.name;
                    var rows = info.couponInfos;
                    var cusStr = '';
                    if(rows) {
                        for(var key in rows){
                            var obj = rows[key];
                            obj.idCard=personInfo.id;
                            if(obj.couponNum==couponNum){
                                personInfo.barcodeImg=obj.barcodeImg
                            }
                            if(obj.type===2) continue;
                            var couponStatus = obj.status==0?0:1
                            var statusTip = obj.status==0?'未使用':'已使用'
                            var str = '<li style="height:65px;" id="coupon-'+key+'" data-input="'+obj.couponNum+'" data-value="'+obj.couponName+'" class="sel-info coupon_sel_'+couponStatus+'" onclick="selCoupon(this);"><div class="coupon_sel_info"><div class="coupon_sel_name">'+obj.couponName+'</div><div class="coupon_sel_tip">限身份证号码为'+obj.idCard+'使用</div></div><div class="coupon_sel_iconbox"><img class="coupon_sel_icon" src="./images/order/coupon.png" /><div class="coupon_sel_status_'+couponStatus+'" >'+statusTip+'</div></div></li><li><div class="input-line"></div></li>';
                            cusStr += str;
                        }
                        var barcodeImgData = 'data:image/jpg;base64,'+personInfo.barcodeImg
                        $('#barcodeImg').attr('src',barcodeImgData);
                    } else {
                        var str = '<li style="text-align:center;color: #00afee;" id="coupon-'+ 0 +'" data-input="'+''+'" data-value="'+''+'" class="sel-info" onclick="selCoupon(this);">'+'您还没有免费券,您可以在公众号点击菜单我的服务-->领取免费券'+'</li><div class="input-line"></div>';

                    }

                }
            });
        }
        
        function initUrlInfo(){
            var url = location.search;
            url = decodeURI(url);
            url = decodeURI(url);
            var Request = new Object();
            if(url.indexOf("?")!=-1){
                var str = url.substr(1);//去掉?号
                strs = str.split("&");
                for(var i=0;i<strs.length;i++){
                    var key = strs[i].split("=")[0];
                    var value = unescape(strs[i].split("=")[1]);
                    Request[key]=value;
                    var keyId = '#' + key;
                    $(keyId).text(value);
                }
            }
            couponNum = Request['couponNum']||'';
            sampleBaseId = Request['sampleBaseId']||'';
            if(couponNum){
                hasCoupon(true)
            }else{
                hasCoupon(false)
            }
        }
        function hasCoupon(flag){

        }
        $(function () {
            if (2 === 1) {
                $("#prompt_message_block").css("background-color", "#ffa800");
            }
            if (errorMsg) {
                $("#tip").css("display", "block");
                setTimeout(closeErrorMsg, 3000);
            }
            analysisIvfRemark();
        });

        function closeErrorMsg() {
            $("#tip").css("display", "none");
        }

        function checkForm(){
            $("#formBtn").attr('disabled', "true");
            $("#ban_bt").css('background', '0');
            $("#formBtn").css('color', '#ACACAC');
            return true;
        }
        function doQuerySample(){
            var url = "/csfy/wx/getSampleBaseDetailInfo.do";
            if(sampleBaseId){
                url = url + '?' + 'sampleBaseId='+sampleBaseId;
            }else{
                alert('对不起未获取到样本信息ID!');
                return
            }
            $.ajax({
                type:"post",
                url:url,
                data:{},
                dataType:"json",
                success:function (data) {
                    if(data.rows) {
                        var order = data.rows[0];
                        fillInfos(order);
                    } else {

                    }

                }
            });
        }
        var infoKeys = ['customerName','departments','doctorName','sampleType','bloodDate','sampleName','sampleSex','sampleAge','isMarried','samplePhoneNum','addressProvince','addressCity','addressCounty','addressStreet','postNum','hospitalNum','idCard','lmp','previousHistory','clinicalDiagnosis'];
        function fillInfos(order){//页面信息填充
            for(var k in infoKeys){
                var infoKey = infoKeys[k];
                $('#'+infoKey).text(order[infoKey]);
            }
        }
    </script>

    <script>
        function analysisIvfRemark(remark) {
            var ivfRemark = remark + "";
            if (ivfRemark === '') return;
            var ivfRemarkText = "";
            if (ivfRemark === '0') {
                ivfRemarkText = "着床一胎";
            }
            if (ivfRemark === '10') {
                ivfRemarkText = "着床两胎,两胎均正常";
            }
            if (ivfRemark === '1211') {
                ivfRemarkText = "着床两胎,一胎停育或减胎,8周内丢失胚胎,距停育后继续妊娠8周及以上"
            }
            $("#ivfRemarkText").text(ivfRemarkText);
        }
        function showCoupon(){
            tipsMsg()
        }
        function tipsMsg(tiptext){//打开提示框
            $("#fade").css('display','block');
            $("#tipDia").css('display','block');
        }

        function closeTips(){//关闭提示框
            $("#tipDia").css('display','none');
            $("#fade").css('display','none');
        }
    </script>
</head>

<body>
    <div id="content">
        <div id="prompt_message_block" class="prompt_message_block">
            <p id="statusTitle" class="prompt_message_l">送检单已通过确认采样,请完成抽血相关事宜</p>
            <div onclick="showCoupon()" style="cursor:pinter;margin:0 auto; overflow:hidden;">
                <img class="prompt_message_icon" src="./images/order/sign.png">
                <div id="couponTip" class="prompt_message_s">已使用免费券,请采样时点击出示给医护人员</div>
            </div>
        </div>
        <div id="sheet">
            <div class="sheet_top">
                <div class="start_block"></div>
                <div class="sheet_top_text">
                    <b>就诊人送检单</b>
                </div>
            </div>
            <div class="sheet_necessary_content round">
                <div class="sheet_text" style="padding-top: 14px">
                    <div class="sheet_label">姓 名:</div>
                    <div id="" class="sheet_value"></div>
                </div>
                <div class="sheet_text" style="padding-top: 14px">
                    <div class="sheet_label">性 别:</div>
                    <div id="" class="sheet_value"></div>
                </div>
                <div class="sheet_text" style="padding-top: 14px">
                    <div class="sheet_label">年 龄:</div>
                    <div id="" class="sheet_value"></div>
                </div>
                <div class="sheet_text" style="padding-top: 14px">
                    <div class="sheet_label">婚 否:</div>
                    <div id="" class="sheet_value"></div>
                </div>
                <div class="sheet_text">
                    <div class="sheet_label" style="word-spacing: 2.5263px">手 机 号:</div>
                    <div id="" class="sheet_value"></div>
                </div>
                <div class="sheet_text">
                    <div class="sheet_label">居住地址:</div>
                    <div id="areaText" class="sheet_value" style="width: 70%;"></div>
                    <script>
                    </script>
                </div>
                <div class="sheet_text" style="padding-top: 14px">
                    <div class="sheet_label">邮 编:</div>
                    <div id="" class="sheet_value"></div>
                </div>
                <div class="sheet_text" style="padding-top: 14px">
                    <div class="sheet_label">门诊/住院号:</div>
                    <div id="" class="sheet_value"></div>
                </div>
                <div class="sheet_text">
                    <div class="sheet_label">证件号码:</div>
                    <div id="" class="sheet_value"></div>
                </div>
                <div class="sheet_text" style="padding-top: 14px">
                    <div class="sheet_label">送检单位:</div>
                    <div id="" class="sheet_value"></div>
                </div>
                <div class="sheet_text" style="padding-top: 14px">
                    <div class="sheet_label">科 室:</div>
                    <div id="" class="sheet_value"></div>
                </div>
                <div class="sheet_text" style="padding-top: 14px">
                    <div class="sheet_label">送检医生:</div>
                    <div id="" class="sheet_value"></div>
                </div>
                <div class="sheet_text" style="padding-top: 14px">
                    <div class="sheet_label">样本类型:</div>
                    <div id="" class="sheet_value"></div>
                </div>
                <div class="sheet_text" style="padding-top: 14px">
                    <div class="sheet_label">采样日期:</div>
                    <div id="" class="sheet_value"></div>
                </div>
                <div class="sheet_text" style="padding-top: 14px">
                    <div class="sheet_label">末次月经:</div>
                    <div id="" class="sheet_value"></div>
                </div>
                <div class="sheet_text" style="padding-top: 14px">
                    <div class="sheet_label">既往史:</div>
                    <div id="" class="sheet_value"></div>
                </div>
                <div class="sheet_text" style="padding-top: 14px">
                    <div class="sheet_label">临床诊断:</div>
                    <div id="" class="sheet_value"></div>
                </div>
            </div>
        </div>
    </div>
    <div id="tip" style="display: none;">
        <p id="tipmsg"></p>
    </div>
    <!-- 遮罩层 -->
    <div id="fade" class="black_overlay"></div>
    <!-- 提示框 -->
    <div id="tipDia" class="tips">
        <p id="tipmsg" style="text-align:center;" class="tips-msg">免费券二维码</p>
        <div class="coupon_box">
            <img id='barcodeImg' style="width:100px;height:100px;display:block;margin:auto;" src="./images/order/coupon_code.png">
        </div>
        <div class="tips-line"></div>
        <p class="tips-close" onclick="closeTips();">返回</p>
    </div>
    
</body>
</html>